﻿@{
    ViewBag.Title = "UpdateAlbumPage";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}
<script type="text/javascript">
    function deleteSonginAlbum(songid) {
        var rs = window.confirm('Bạn muốn xoá bài hát này ra khỏi album?');
        if (rs) {
            $.ajax({
                url: '/managealbum/deleteSonginAlbum',
                data: { 'songid': songid },
                contentType: 'application/json; charset=utf-8',
                dataType: "json",
                success: function (result) {
                    location.reload();
                }
            });
        }
        else {
            return false;
        }
    }
    
</script>

<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
<tr>
	<th rowspan="3" class="sized"><img src="../../Images/AdminImages/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
	<th class="topleft"></th>
	<td id="tbl-border-top">&nbsp;</td>
	<th class="topright"></th>
	<th rowspan="3" class="sized"><img src="../../Images/AdminImages/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
</tr>
<tr>
	<td id="tbl-border-left"></td>
	<td>
	<!--  start content-table-inner -->
	<div id="content-table-inner">
	
	<table border="0" width="100%" cellpadding="0" cellspacing="0">
	<tr valign="top">
	<td>
	
	
		<!--  start step-holder -->
		<div id="step-holder">
            <div class="step-no-off">+</div>
			<div class="step-light-left"><a href="/managealbum/ViewAllAlbum?pageindex=1">Xem tất cả</a></div>
			<div class="step-light-right">&nbsp;</div>			
			<div class="step-no-off">+</div>
			<div class="step-light-left"><a href="/managealbum/UploadAlbumPage">Upload album mới</a></div>
			<div class="step-light-right">&nbsp;</div>	
            <div class="step-no">+</div>
			<div class="step-dark-left"><a href="">Cập nhật album</a></div>
			<div class="step-dark-right">&nbsp;</div>			
			<div class="clear"></div>
		</div>
		<!--  end step-holder -->
	
		<!-- start id-form -->   
        <form id="frm" action="/managealbum/ConfirmUpdateAlbum" method="post" enctype="multipart/form-data">
		<table border="0" width="100%" cellpadding="0" cellspacing="0"  id="id-form">
		<tr>            
			<th valign="top">Tên Album</th>
			<td><input type="text" id="albumname" name="albumname" value="@Model.AlbumName" class="inp-form" /></td>
			<td></td>
		</tr>
		<tr>
			<th valign="top">Ca sĩ:</th>
			<td><input type="text" id="singername" name="singername" value="@Model.SingerName" class="inp-form" /></td>
			<td></td>
		</tr>
        <tr>
			<th valign="top">Năm phát hành</th>
			<td><input type="text" id="releaseyear" name="releaseyear" value="@Model.ReleaseYear" class="inp-form" /></td>
			<td></td>
		</tr>
		<tr>
		<th valign="top">Thể loại:</th>
		<td>	
		<select  class="styledselect_form_1" id="category" name="category">
			<option value="">--Chọn--</option>
			@foreach (ListenMusic.Category_ServiceReference.Category ct in ViewBag.category)
               {
                   if (ct.CategoryID == @Model.CategoryID)
                   {
                    <option selected="selected" value="@ct.CategoryID">@ct.CategoryName</option>
                   }
                   else
                   { 
                    <option value="@ct.CategoryID">@ct.CategoryName</option>
                   }
               }
		</select>
		</td>
		<td></td>
		</tr>
		<tr>
		<th valign="top">Quốc gia:</th>
		<td>	
		<select  class="styledselect_form_1" id="country" name="country">
			<option value="">--Chọn--</option>
			@foreach (ListenMusic.Country_ServiceReference.Country ct in ViewBag.country)
               {
                   if (ct.CountryID == @Model.CountryID)
                   {
                     <option  selected="selected" value="@ct.CountryID">@ct.CountryName</option>
                   }
                   else
                   { 
                    <option value="@ct.CountryID">@ct.CountryName</option>
                   }
               }
		</select>
		</td>
		<td></td>
		</tr> 		
		<tr>	
        <th valign="top">Hình Album:</th>	
		<td><input type="file" id="filepicture" name="filepicture" class="file_1" /></td>        
	    <td>
	        <div class="bubble-left"></div>
	        <div class="bubble-inner">Bạn có thể chọn hình có đuôi là PNG, JPEG, JPG.</div>
	        <div class="bubble-right"></div>
	    </td>
	</tr>	
    <tr>	
        <th valign="top">Ảnh hiện tại: </th>	
		<td><img src="../../Images/albums/@Model.Picture" alt="" width="80" height="80" /><input type="hidden" id="oldpicture" name="oldpicture" value="@Model.Picture" /></td>     
	    <td>
	        
	    </td>
	</tr>
    <tr>
        <th>Thông tin Album:</th>
        <td><textarea rows="" cols="" name="description" id="description" class="form-textarea">@Model.Description</textarea></td>
    </tr>	
    

	<tr>
		<th>&nbsp;</th>
		<td valign="top">
            <input type="hidden" id="albumid" name="albumid" value="@Model.AlbumID" />            
			<input type="submit" value="" class="form-submit" />
			<input type="reset" value="" class="form-reset"  />
		</td>
		<td></td>
	</tr>
	</table>
    </form>  
   
	<!-- end id-form  -->

	</td>
	<td>
    <div id="related-activities">
		
		<!--  start related-act-top -->
		<div id="related-act-top">
		<img src="../../Images/AdminImages/forms/title_album.gif" width="271" height="43" alt="" />
		</div>
		<!-- end related-act-top -->
		
		<!--  start related-act-bottom -->
		<div id="related-act-bottom">
		
			<!--  start related-act-inner -->
			<div id="related-act-inner">
			
				@*<div class="left"><a href=""><img src="../../Images/AdminImages/forms/icon_plus.gif" width="21" height="21" alt="" /></a></div>*@
				<div class="right">
					@*<h5>Các bài hát trong album</h5>	*@
                    <ul class="greyarrow">
                     @foreach (ListenMusic.AdminSong_ServiceReference.SongAlbum sa in @Model.lstsongAlbum)
                        { 
                            <li>@sa.SongName <a href="javascript:deleteSonginAlbum(@sa.SongID)">Xoá</a></li> <br />
                        }
					</ul>
                    <div style="margin-bottom:8px;">
                        <form action="/managealbum/AddSongInAlbum" id="frmaddSong" method="post">
                            <input type="hidden" name="albumid" value="@Model.AlbumID" />
                            <input type="hidden" name="albumname" value="@Model.AlbumName" />
                            <input type="hidden" name="singername" value="@Model.SingerName" />
                            <input type="hidden" name="category" value="@Model.CategoryID" />
                            <input type="hidden" name="country" value="@Model.CountryID" />
                            <input type="submit" class="button-sub" value="+Thêm bài hát vào album ..." />
                        </form>
                        
                        
                    </div>    					
				</div>                
			</div>
			<!-- end related-act-inner -->
			<div class="clear"></div>
		
		</div>

         

		<!-- end related-act-bottom -->
	
	</div>
	<!-- end related-activities -->	
</td>
</tr>
<tr>
<td><img src="../../Images/AdminImages/shared/blank.gif" width="695" height="1" alt="blank" /></td>
<td></td>
</tr>
</table>
 
<div class="clear"></div>
 

</div>
<!--  end content-table-inner  -->
</td>
<td id="tbl-border-right"></td>
</tr>
<tr>
	<th class="sized bottomleft"></th>
	<td id="tbl-border-bottom">&nbsp;</td>
	<th class="sized bottomright"></th>
</tr>
</table>

<div class="clear">&nbsp;</div>

